/**
 * 飞控大作业
 *
 * File:		uart_util.h
 * Brief:		UART的功能函数
 * Author:      Duan Yuhao
 * Modified:	2022/5/25
 *
 */


#ifndef UART_UTIL_H
#define UART_UTIL_H


#ifdef __cplusplus
extern "C" {
#endif


#include "stm32f4xx_hal.h"
#include "usart.h"


void Uart_RxIdleCallback(UART_HandleTypeDef* huart);
void Uart_SendMessage(UART_HandleTypeDef* huart, uint8_t txdata[], uint16_t size, uint32_t timeout);
void Uart_SendMessage_IT(UART_HandleTypeDef* huart, uint8_t txdata[], uint16_t size);
void Uart_SendMessage_IT_Force(UART_HandleTypeDef* huart, uint8_t txdata[], uint16_t size, uint32_t timeout);
void Uart_ErrorHandler(uint32_t ret);
void Uart_ReceiveHandler(UART_HandleTypeDef *huart);


#ifdef __cplusplus
}
#endif


#endif
